extends ../main

block append body
    div#prodList.panel.box-shadow-none.content-header
        div.panel-body
            div.col-md-12
                h3.animated.fadeInLeft 产品管理
                p.animated.fadeInDown
                    | 产品管理&nbsp;
                    span.fa-angle-right.fa
                        | &nbsp;产品列表
    div.col-md-12.top-20.padding-0
        div.col-md-12
            div.panel
                div.panel-body
                    div#toolbar.btn-group
                        button#btn_add.btn.btn-default(type="button")
                            span.glyphicon.glyphicon-plus(aria-hidden="true") 新增
                        button#btn_edit.btn.btn-default(type="button")
                            span.glyphicon.glyphicon-plus(aria-hidden="true") 修改
                        button#btn_del.btn.btn-default(type="button")
                            span.glyphicon.glyphicon-plus(aria-hidden="true") 删除
                    table#tb_departments

block append footer
    script(type="text/javascript").
        $(function () {
            var app = new Vue({
                el:"#prodList",
                data:{

                },
                methods:{
                    init:function () {
                        var columns = [{
                            checkbox: true
                        }, {
                            field: 'prodName',
                            width: '20%',
                            title: '商品名称'
                        }, {
                            field: 'prodDesc',
                            width: '25%',
                            title: '商品描述'
                        }, {
                            field: 'prodIcon',
                            width: '15%',
                            title: '商品图标',
                            formatter: function (value, row, index) {
                                return '<img width="15%" src="' + value + '" />';
                            }
                        }, {
                            field: 'prodDiscountPrice',
                            title: '会员价格',
                            formatter: function (value, row, index) {
                                return value / 100 + '元';
                            }
                        }, {
                            field: 'prodPrice',
                            title: '商品价格',
                            formatter: function (value, row, index) {
                                return value / 100 + '元';
                            }
                        }, {
                            field: 'prodMinPrice',
                            title: '商品进价',
                            formatter: function (value, row, index) {
                                return value / 100 + '元';
                            }
                        }, {
                            field: 'createTime',
                            title: '创建时间'
                        }];
                        var tableInit = zxlib.datatable("tb_departments","prod_id","/manager/prod/getProdList",columns);
                        console.log(tableInit);
                        tableInit.init();

                        var oButtonInit = new ButtonInit();
                        oButtonInit.Init();
                    }
                }
            });

            app.init();
        });

        var ButtonInit = function () {
            var oInit = new Object();

            oInit.Init = function () {
                //初始化页面上面的按钮事件
                $('#btn_add').click(function () {

                });

                $('#btn_edit').click(function () {

                });

                $('#btn_delete').click(function () {

                });
            };

            return oInit;
        };
